<!DOCTYPE html>
<extend name="Base/base" />
<block name='head'>  
    <meta charset="utf-8">
    <link href="/Public/Index/css/workflow.css" rel="stylesheet" /> 
    <style type="text/css">
        .t4{color:#bbb}
        /*出差小结－转交下一步骤开始*/
        .top{
            height:5px;
        }
        .bottom{
            height:20px;

            .comments{
                border:3px solid #CFDDEA;
            }
            .com1 {
                width:10%;
                font-weight:inherit;
                text-align:left;
            }

            .fil{
                border:1px solid #CFDDEA;
            }
        </style>
    </block>
    <block name="content" > 
        <form>
            <div class="bd">
                <div class="trip_title">
                    <h2>公告查询</h2>
                </div>
                <div class="work_cells trip_next">
                    <p class="top"></p>
                    <table>
                        <tr>
                            <td class="key">发布人</td>
                            <td class="text_value"><input type='text' name='from_id' id="provider" ></td>
                        </tr>
                        <tr>
                            <td class="key">公告标题</td>
                            <td class="text_value"><input type='text' name='subject' id="subject" ></td>
                        </tr>
                        <tr>
                            <td class="key">公告类型</td>
                            <td class="text_value">
                                <select name="type_id" id="type_id" >
                                    <option value="0">全部</option>
                                    <foreach name='cates' item='cate'>
                                        <option value="{$cate.code_no}">{$cate.code_name}</option>
                                    </foreach>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="key">发布日期</td>
                            <td class="text_value">
                                <input type="text" style='border:1px solid #E5E5E5;width:35%;' id="start" class="dateTime" name="start" placeholder="双击打开日历">&nbsp;至&nbsp;
                                <input type="text" style='border:1px solid #E5E5E5;width:35%;' id="end" class="dateTime" name="end" placeholder="双击打开日历">
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="button" style="margin-left:23%;margin-top:0px;margin-bottom:0px;">
                    <span>
                        <a class="pointer search" style='background: #ED8D76' data-verify="all" data-url="{:U('search')}" data-form="">查询</a>
                        <a class="pointer restart" style='background: #5FC6C6;' data-verify="all" data-form="">重置</a>
                    </span>
                </div>
            </div>
        </form>
        <div class="transferred_table">
        </div>
        <p class="bottom"></p>
        <div class="button">
            <a class="am-btn" onclick="history.go(-1)">返 回</a>
        </div>

    </block>
    <block name="script">
        <script type="text/javascript" src="/Public/Index/js/news.js"></script>
        <script type="text/javascript" src="/Public/Index/js/notice.js"></script>
        <script type="text/javascript">
                $(dateTime(0));
                $(function () {
                    $('.search').click(function () {
                        var data = $('form').serialize();
                        var url = $(this).attr('data-url');
                        $.post(url, data, function (res) {
                            console.log(res)
                            var html = '<table><th>标题</th><th>发布时间</th>';
                            for (var i = 0; i < res.length; i++) {
                                html += '<tr>';
                                html += '<td align="left"><a href="/index.php/Index/Notice/show/notify_id/' + res[i].notify_id + '">' + res[i].subject + '</a></td>';
                                html += '<td align="center"><a href="/index.php/Index/Notice/show/notify_id/' + res[i].notify_id + '">' + res[i].send_time + '</a></td>';
                                html += '</tr>';
                            }
                            html += '</table>';
                            $('.transferred_table').html(html)
                        })

                    })

                    $('.restart').click(function () {
                        $('#myform')[0].reset();
                        $('.transferred_table').html('');
                    })

                })
        </script>
    </block>
